# list1 = [1, 2, 1, 3, 5, 5]
# list2 = []
# for i in list1:
#     if i not in list2:
#         list2.append(i)
# # print(list2)
# lst = []
# with open('abc.txt', 'r', encoding='utf8') as f:
#     a = f.readlines()
#     for i in a:
#         b = i.split(',')
#         lst.append(b)
#     print(lst)

import re
import time
import requests
import uuid

url_page = 'https://www.enterdesk.com/tag-%E9%85%A5%E8%83%B8/'
ret = requests.get(url=url_page)
print(ret.text)
url_list = re.findall(r'https://up.enterdesk.com/edpic_360_360/.*?\.jpg', ret.text)
for url in url_list:
    res = requests.get(url=url)
    time.sleep(0.5)
    content = res.content
    name = str(uuid.uuid1()) + '.jpg'
    with open(name, 'wb') as f:
        print('正在下载%s' %name)
        f.write(content)
